package com.tutos.ui.monitor;

import javax.inject.Inject;


import com.tutos.dao.MonitorDAO;
import com.tutos.ui.BaseMain;
import com.tutos.ui.MenuBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.terminal.Sizeable;

public class MainMonitor implements BaseMain, MenuBase.MenuListener{
	
	private HorizontalSplitPanel panel = new HorizontalSplitPanel();
	private MenuBase menu;
	private MonitorDAO dao;	
	
	
	@Inject
	public MainMonitor(MenuBase menu, MonitorDAO dao){
		this.menu = menu;
		this.dao = dao;
		
		menu.addListener(this);
		panel.setFirstComponent(menu.getComponent());
		//Horario hor = new Horario(new MonitorDAO());
		//panel.setSecondComponent(hor.getComponent());
		panel.setSplitPosition(100, Sizeable.UNITS_PERCENTAGE);
		panel.setLocked(true);
		panel.setSizeFull();
		panel.setSplitPosition(9);
	}	

	@Override
	public Component getComponent() {
		return panel;
	}

	@Override
	public void menuClick(Component component) {
		panel.setSecondComponent(component);
		
	}
	
}
